import React, { useEffect, useState } from 'react';
import { Modal, Form, Space, Popconfirm } from 'antd';
import FormCondition from '@/components/FormCondition';
import { connect, history } from 'umi';
import { Button, Row, Col } from 'antd';
import { dateNowYearDisabled, dateNowDisabled } from '@/common/regular';
import moment from 'moment';
const CheckOrderForm = (props) => {
    const { visible = false, onClose, loading, dispatch, handleCallback, } = props;
    const { show = false, detail = {} } = visible;

    console.log(detail)

    const [form] = Form.useForm();
    // 确认提交
    const handleUpAudit = () => {
        form.validateFields().then((values) => {
            handleCallback(values)
            onClose()
        });
    };

    const formItems = [
        {
            label: `链接地址`,
            name: 'linkSrc',

        },
    ];

    const modalProps = {
        title: '自定义链接',
        width: 800,
        visible: show,
        maskClosable: true,
        destroyOnClose: true,
        zIndex: 1001,
        confirmLoading: loading,
    };

    return (
        <Modal {...modalProps} onCancel={onClose} onOk={handleUpAudit}>
            <FormCondition form={form} initialValues={detail} formItems={formItems}></FormCondition>
        </Modal>
    );
};

export default connect(({ order, loading }) => ({
    loading: loading.effects['order/fakeCheckOrder'],
}))(CheckOrderForm);
;
